#!/bin/bash
# PATCHIT SCRIPT
# PATCH SCRIPT FOR REDHAT CLUSTER TOOLS 
#       NETWORK BLOCK DEVICE DRIVER
# VERSION 2.01.00
# ----------------------------------------

VERSION="2.01.00"
FILES="./gnbd/client/Makefile ./gnbd/client/monitor_req.c ./gnbd/utils/trans.c"
PTCH=`which patch`

echo "PREPARING TO PATCH CLUSTERTOOLS/GNBD VERSION $VERISON"

for a in $FILES; do 
    if [ -s $a ];then
       echo "...PATCHING $a"
       $PTCH $a $a.patch
       echo "...DONE"
    else
	echo "ERROR :: COULD NOT FIND FILE : $a"
	exit 1;
    fi
done;

echo "DONE PATCHING...CONFIGURE AND INSTALL CLUSTERTOOLS/GNBD"
exit 0;

#--EOF
